home *** CD-ROM | disk | FTP | other *** search
/ Aminet 8 / Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso / Aminet / comm / fido / MM_ScriptSet1.lha / MM_PGP.rexx < prev    next >
OS/2 REXX Batch file  |  1995-08-14  |  2KB  |  72 lines

  1. /*
  2. ** MM_PGP.rexx v1.0 by Tomasz Nidecki
  3. ** 
  4. ** This script allows you to encrypt and decrypt PGP messages
  5. ** from your Browse menu. The message you are reading can be
  6. ** encrypted or decrypted with signatures, etc.
  7. ** attn! pgp must be in your path for this to work, and its
  8. ** directory must have a PGP: assign to it. Also set the
  9. ** environment variable PGPPATH to the right path.
  10. **
  11. ** If message is written to you, it will be decoded,
  12. ** if it is written by you, it will be encoded.
  13. ** If none of these cases is true, nothing will be done.
  14. **
  15. ** ATTENTION! Make sure that the key you are trying to
  16. ** encode with is a certified key! If not, i've had problems with
  17. ** this script (PGP freezing and taking up memory...)
  18. **
  19. ** Also notice that your secret password will be visible in
  20. ** the requester, so don't enter it when someone's around...
  21. **
  22. ** Args: rx MM_PGP.rexx %a %n
  23. */
  24.  
  25. ADDRESS "MAILMANAGER"
  26.  
  27. PARSE ARG area_tag msg_num
  28.  
  29. MM_ReadMsg area_tag msg_num read_stem
  30. MM_GetSysop sysop_name
  31.  
  32. IF read_stem.from = sysop_name
  33. THEN
  34. DO
  35.  
  36.   MM_StringReq '"'Secret phrase'"' sec_phrase
  37.   ADDRESS COMMAND "setenv PGPPASS" sec_phrase
  38.   MM_WriteStem "t:mm" read_stem.text
  39.  
  40.   ADDRESS COMMAND "delete >NIL: t:mm.asc"
  41.   ADDRESS COMMAND "PGP:PGP +force -esa t:mm" read_stem.to
  42.   ADDRESS COMMAND "delete >NIL: ENV:PGPPASS"
  43.  
  44.   edit_stem.flags = 'SENT'
  45.   edit_stem.file = "t:mm.asc"
  46.   MM_EditMsg area_tag msg_num edit_stem
  47.   set_flags = "!SENT"
  48.   MM_EditMsgFlags area_tag msg_num 'set_flags'
  49.   ADDRESS COMMAND "delete >NIL: t:mm"
  50.  
  51. END
  52. ELSE
  53. IF read_stem.to = sysop_name
  54. THEN
  55. DO
  56.  
  57.   MM_StringReq '"'Secret phrase'"' sec_phrase
  58.   ADDRESS COMMAND "setenv PGPPASS" sec_phrase
  59.   MM_WriteStem "t:mm.pgp" read_stem.text
  60.  
  61.   ADDRESS COMMAND "PGP:PGP t:mm.pgp"
  62.   ADDRESS COMMAND "delete >NIL: ENV:PGPPASS"
  63.  
  64.   edit_stem.flags = 'SENT'
  65.   edit_stem.file = "t:mm"
  66.   MM_EditMsg area_tag msg_num edit_stem
  67.   set_flags = "SENT"
  68.   MM_EditMsgFlags area_tag msg_num 'set_flags'
  69.   ADDRESS COMMAND "delete >NIL: t:mm"
  70.  
  71. END
  72.